//package com.erebus.services;
//import org.springframework.ai.chat.client.RequestResponseAdvisor;
//
//import org.springframework.ai.chat.client.advisor.api.AdvisedRequest;
//import org.springframework.ai.chat.client.advisor.api.AdvisedResponse;
//import org.springframework.ai.chat.client.advisor.api.CallAroundAdvisorChain;
//import org.springframework.ai.chat.client.advisor.api.StreamAroundAdvisorChain;
//import org.springframework.ai.chat.model.ChatResponse;
//import reactor.core.publisher.Flux;
//
//import java.util.Map;
//import org.springframework.ai.chat.client.observation.ChatClientObservationRegistry;
//import org.springframework.ai.chat.client.observation.ChatClientObservationRegistryCustomizer;
//import org.springframework.ai.chat.client.observation.DefaultChatClientObservationConvention;
//import org.springframework.ai.chat.observation.ChatModelObservationContext;
//import org.springframework.ai.chat.observation.ChatModelObservationPredicate;
//import org.springframework.stereotype.Component;
//
//@Component
//public class LoggingAdvisor implements ChatClientObservationRegistryCustomizer {
//
//    @Override
//    public void customize(ChatClientObservationRegistry registry) {
//        registry.observationConfig()
//                .observationPredicate(ChatModelObservationPredicate.ALL)
//                .observationHandler(context -> {
//                    // 请求信息
//                    System.out.println("【请求】用户输入: " + context.request().user());
//                    System.out.println("【请求】系统提示: " + context.request().system());
//
//                    // 响应信息
//                    if (context.response() != null) {
//                        System.out.println("【响应】内容: " + context.response().content());
//                    }
//                });
//    }
//}
